package com.goodving.guli.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.goodving.guli.R;

/**
 * Created by john on 2015/11/23.
 */
public class WeightView extends LinearLayout {
    private WeightProgressBar f10858a;
    private TextView f10859b;
    private TextView f10860c;
    private TextView f10861d;
    private TextView f10862e;

    public WeightView(Context context) {
        this(context, null);
    }

    public WeightView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public WeightView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f10858a = null;
        this.f10859b = null;
        this.f10860c = null;
        this.f10861d = null;
        this.f10862e = null;
        LayoutInflater.from(context).inflate(R.layout.view_weight_std, this);
        this.f10858a = (WeightProgressBar) findViewById(R.id.weight_pb);
        this.f10859b = (TextView) findViewById(R.id.weight_value_tv);
        this.f10860c = (TextView) findViewById(R.id.weight_unit_tv);
        this.f10861d = (TextView) findViewById(R.id.weight_bmi_tv);
        this.f10862e = (TextView) findViewById(R.id.weight_tips_tv);
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C4005t.WeightView);
        m15390b(obtainStyledAttributes.getDimension(0, 20.0f));
        m15398e(obtainStyledAttributes.getDimension(7, 40.0f));
        m15400f(obtainStyledAttributes.getDimension(10, 12.0f));
        m15402g(obtainStyledAttributes.getDimension(13, 12.0f));
        m15404h(obtainStyledAttributes.getDimension(16, 13.0f));
        m15388a(obtainStyledAttributes.getColor(1, 0xFF596069));
        m15394c(obtainStyledAttributes.getColor(2, -1));
        m15397d(0);
        m15391b(obtainStyledAttributes.getColor(3, 0xFF7EA800));
        m15399e(obtainStyledAttributes.getColor(6, -1));
        m15401f(obtainStyledAttributes.getColor(9, 0xFFC1C3C5));
        m15403g(obtainStyledAttributes.getColor(12, 0xFF9DA0A4));
        m15405h(obtainStyledAttributes.getColor(15, 0xFFE1E2E3));
        m15387a(obtainStyledAttributes.getFloat(4, 100.0f));
        m15393c(obtainStyledAttributes.getFloat(5, 0.0f));
        String string = obtainStyledAttributes.getString(8);
        if (string != null) {
            m15389a(string);
        }
        string = obtainStyledAttributes.getString(11);
        if (string != null) {
            m15392b(string);
        }
        string = obtainStyledAttributes.getString(14);
        if (string != null) {
            m15395c(string);
        }
        obtainStyledAttributes.recycle();
    }

    public void m15387a(float f) {
        this.f10858a.m15366c(f);
    }

    public void m15388a(int i) {
        this.f10858a.m15365b(i);
    }

    public void m15389a(String str) {
        this.f10860c.setText(str);
    }

    public void m15390b(float f) {
        this.f10858a.m15368d(f);
    }

    public void m15391b(int i) {
        this.f10858a.m15363a(i);
    }

    public void m15392b(String str) {
        this.f10861d.setText(str);
    }

    public void m15393c(float f) {
        this.f10858a.m15362a(f);
        this.f10859b.setText(C3657a.f18328f + f);
    }

    public void m15394c(int i) {
        this.f10858a.m15367c(i);
    }

    public void m15395c(String str) {
        this.f10862e.setText(str);
    }

    public void m15396d(float f) {
        this.f10858a.m15364b(f);
    }

    public void m15397d(int i) {
        this.f10858a.m15369d(i);
    }

    public void m15398e(float f) {
        this.f10859b.setTextSize(f);
    }

    public void m15399e(int i) {
        this.f10859b.setTextColor(i);
    }

    public void m15400f(float f) {
        this.f10860c.setTextSize(f);
    }

    public void m15401f(int i) {
        this.f10860c.setTextColor(i);
    }

    public void m15402g(float f) {
        this.f10861d.setTextSize(f);
    }

    public void m15403g(int i) {
        this.f10861d.setTextColor(i);
    }

    public void m15404h(float f) {
        this.f10862e.setTextSize(f);
    }

    public void m15405h(int i) {
        this.f10862e.setTextColor(i);
    }
}
